package com.chenpeijian.demo.demos.web.service;

import com.alibaba.fastjson2.JSON;
import com.burukeyou.uniapi.http.core.response.HttpResponse;
import com.chenpeijian.demo.service.UserHttpApi;
import com.chenpeijian.demo.service.dto.Add4DTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: student_code
 * @description:
 * @author: 陈培建
 * @create: 2025-01-17 11:42
 * https://mp.weixin.qq.com/s/iKTyydSEjwI0Cyxy89u-dQ
 **/
@Service
public class UserAppService {
    @Autowired
    private UserHttpApi userHttpApi;

    public void doSomething(){
        String jay = userHttpApi.getUser("jay", 3);
        System.out.println("doSomething" + jay);
    }

    public void adduser(Add4DTO add4DTO){
        Add4DTO result = userHttpApi.addUser(add4DTO);
        System.out.println("adduser：" + JSON.toJSONString(result));
    }
    public void addUserStatus(Add4DTO add4DTO){
        HttpResponse<Add4DTO> add4DTOHttpResponse = userHttpApi.addUserStatus(add4DTO);
        System.out.println("adduser：" + JSON.toJSONString(add4DTOHttpResponse));
        System.out.println("result：" + JSON.toJSONString(add4DTOHttpResponse.getBodyResult()));
    }
}
